<!DOCTYPE html>
<html>
	<head>
	<title></title>
	<meta charset="utf-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<meta name="viewport" content="width=device-width,initial-scale=1.0,minimum-scale=1,maximum-scale=1,user-scalable=no" />
	<meta content="yes" name="apple-mobile-web-app-capable">
	<meta content="yes" name="apple-touch-fullscreen">
	<meta content="telephone=no,email=no" name="format-detection">
	<script type="text/javascript" src="http://www.youyiku-yishu.cn/Apps/WebApp/View/default/js/photoNewBook/jisuan.js"></script>
	<link rel="stylesheet" href="../css/photoNewBook/address.css">
	</head>
	<body>
		<div class="mian">
			<div class="return">
				 <img src="http://www.youyiku-yishu.cn/Apps/WebApp/View/default/images/index/app/index/fanhui_zuo.png" alt="" class="img_1" onclick="Return(2)"/>
				 <b>我的收货地址</b>
				 <div class="superinduce" onclick="appendaddress()">添加地址</div>
			</div>
			<div class="orientate">
				<img src="http://www.youyiku-yishu.cn/Apps/WebApp/View/default/images/index/app/my/dingwei_1.png" alt="" />
				<span>您还没有收货地址哦！</span>
			</div>
			<div class="complete">
				
			</div>
				
				
									
				
				
				
			<!--返回上一页-->
<input type="hidden" name="" id="recurrence" value="2" />
	</body>

<script type="text/javascript" src="http://www.youyiku-yishu.cn/Apps/WebApp/View/default/js/photoNewBook/jquery-1.10.2.min.js"></script>
<script type="text/javascript" src="../js/photoNewBook/personal.js"></script>
<script src="../js/communal.js"></script>
<script type="text/javascript">
	window.onload=function(){
		var userId = sessionStorage.getItem("userId");
		$.ajax({
							type:"POST",
							url:"http://www.youyiku-yishu.cn/WebApp/AppOrders/getAddress",
							data:{userId:userId},
						    dataType:"json",
							beforeSend: function (XMLHttpRequest) {
							XMLHttpRequest.setRequestHeader("DEVICEINFO", "JxRaZezavm3HXM3d9pWnYiqqQC1SJbsU");
													       }
							}).then(data=>{
								var data=data;
								var address=data.address;
								if(data==null){
									 $('.complete').css('display','none');
								}else{
									var depot="";
									 for (var i=0;i<address.length;i++){
									 	depot+='<div class="particulars">';
									 	depot+='<img src="http://www.youyiku-yishu.cn/Apps/WebApp/View/default/images/index/app/my/dizhi_1.png" alt="" />';
									 	depot+='<div class="particulars_div">';
									 	depot+='<div class="particulars_div0">';
										depot+='<span class="name">'+address[i].addressee+'</span>';
										depot+='<span class="phone">'+address[i].phone+'</span>';
										depot+='</div>'	;
										depot+='<div class="particulars_div1">';
										depot+='<span class="code1">'+address[i].province+'</span>';
										depot+='<span class="code2">'+address[i].city+'</span>';
										depot+='<span class="code3">'+address[i].district+'</span>';
										depot+='<span class="address">'+address[i].address+'</span>';
										depot+='</div>'	;
										depot+='</div>';
										depot+='<div class=" line"></div>';
										depot+='<div class="editor" onclick="editor('+address[i].addId+')">编辑</div>';
										depot+='</div>';
									 }
									 	 $('.complete').html(depot);
									 	 $('.orientate').css('display','none');
								}
								 
								  
									
									 
					
				 })
	}
	function appendaddress(){
	location.href = 'appendaddress.html';
}
		function editor(id){
		var addId=id;
		sessionStorage.setItem("addId", addId);
		location.href='reviseaddress.html';
	}

</script>
</html>
